package system_code.read_write;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class demo2 {
    //字符流读文件
    public static void main(String[] args) throws IOException {
        Reader read = new FileReader("a.txt");
        while(true){
            int ret = read.read();
            if(ret == -1){
                break;
            }
            char ch = (char)ret;
            System.out.print(ch);
        }
        read.close();
    }
}
